<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\datetime\DateTimePicker;
use frontend\modules\resource\logic\BranchLogic;

/* @var $this yii\web\View */
/* @var $model common\models\Branch */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="branch-form">

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'color_value')->dropDownList(BranchLogic::colorMap(), ['prompt' => '选择主题色']) ?>

    <?= $form->field($model, 'br_sort')->textInput() ?>

    <?= $form->field($model, 'start_time', ['options' => ['class' => 'search_input_date']])->widget(DateTimePicker::classname(), [
        'options' => ['placeholder' => ''],
        'pluginOptions' => [
            'format' => 'yyyy-mm-dd',
            'autoclose' => true,
            'startView' => 2,
            'minView' => 2,
            'maxView' => 2,
            'todayBtn' => true
        ]
    ]); ?>

    <?= $form->field($model, 'end_time', ['options' => ['class' => 'search_input_date mr']])->widget(DateTimePicker::classname(), [
        'options' => ['placeholder' => ''],
        'pluginOptions' => [
            'format' => 'yyyy-mm-dd',
            'autoclose' => true,
            'startView' => 2,
            'minView' => 2,
            'maxView' => 2,
            'todayBtn' => true
        ]
    ]); ?>

    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? '提 交' : '修 改', ['class' => $model->isNewRecord ? 'btn btn-success s-btn' : 'btn btn-primary s-btn']) ?>
        <?= Html::resetButton('重置', ['class' => 'btn btn-primary', 'name' => 'submit-button']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
